using Assets.Scripts.GDK;
using System;
using UnityEngine;

namespace Brick
{
	public class CloseADAlert : gdk_base_alert_layer
	{
		private Action callback;

		public void OnData(Action _callback)
		{
			callback = _callback;
		}

		public override void OnLoad()
		{
		}

		public void OncloseClick()
		{
			close();
			if (callback != null)
			{
				callback();
			}
		}

		public void OnBtnClick()
		{
			close();
			GDK.ModuleManger.Module<ShopPanelModule>().SetPage(0);
			gdk_game_manager.showAlert(PanelID.SHOP, delegate (GameObject node)
			{
				node.GetComponent<ShopPanel>().OnData(delegate
				{
					callback();
				});
			});
		}
	}
}

